package com.spark.lola.service.pur;

import com.spark.lola.entity.pur.OrderInfo;
import com.spark.lola.entity.pur.OrderLocation;
import com.spark.lola.entity.pur.OrderProcess;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.core.entity.KafkaMessage;
import com.spark.lola.support.mybatis.service.BaseService;
import com.spark.lola.support.wms.request.OrderActionRequest;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author dengyejun
 * @since 2020-04-24
 */
public interface IOrderInfoService extends BaseService<OrderInfo> {
    OrderInfo findFullById(Long id);
    OrderInfo findFullByNo(String no);

    OrderInfo add(OrderInfo form, ShiroUser shiroUser) throws Exception;

    OrderInfo update(OrderInfo form, ShiroUser shiroUser)throws Exception;

    void deleteById(Long id, ShiroUser shiroUser) throws Exception;

    List<OrderProcess> logs(Long id);

    void reject(KafkaMessage kafkaMessage,OrderActionRequest request, ShiroUser shiroUser) throws Exception;

    void checking(OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    void eceiving(OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    void pricing(KafkaMessage kafkaMessage,OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    void adjusting(OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    void replying(OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    void paying(KafkaMessage kafkaMessage,OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    void recycle(Long orderId,ShiroUser shiroUser) throws Exception;

    void canceling(OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    Long returning(KafkaMessage kafkaMessage,OrderActionRequest request,ShiroUser shiroUser) throws Exception;

    boolean updateLoaction(OrderLocation form);

    /**
     * 获取订单指定状态日志
     */
    OrderProcess getOrderProcess(Long orderId,Integer status);

    Map<String,BigDecimal> statistics(Integer type, Long byId, String start, String end);

    BigDecimal waitingPayment(Integer type, Long byId,List<String> salesmanIds,String start, String end);

    BigDecimal waitingPayment(Integer type, Long byId,List<String> salesmanIds);

    BigDecimal supplierWaitingPayment(Long supplierId,String start, String end);

    BigDecimal supplierWaitingPayment(Long supplierId);

    Map<Integer, Integer> orderCountByStatus(Integer type, Long byId,List<String> salesmanIds);

}
